package alphabeta;
import game.HexGameFrame;
import game.Location;

///MoveEvaluation(): storage for keeping track of score/location
public class MoveEvaluation {
	private Location location = null;
  private final double myResistance;
  private final double otherResistance;
  private final int whichPlayer;
	
	
  public MoveEvaluation(double myResistance, double otherResistance, int whichPlayer) {
    this.myResistance = myResistance;
    this.otherResistance = otherResistance;
    this.whichPlayer = whichPlayer;
  }
  
  
	public Location getLocation()	{	return this.location;	}
	
	
	public double getScore() {	
	  int strategy = HexGameFrame.strategyButtonGroups[whichPlayer-1].getIndex();
	  return strategy == 0 ? myResistance    :
           strategy == 1 ? otherResistance :
                           myResistance/otherResistance;
	}
	
	
	public void setLocation(Location loc) {
	  location = loc;
	}
	
	
	@Override
  public String toString() {
	  return location + 
	         "(" + (int)myResistance + " # " + (int)otherResistance + " => " + getScore() + ")";
	}


}